import { Descriptions, Modal } from 'antd';
import { useState, useEffect } from 'react'
export default function DetailModal(props) {
    const { record, cztxlDefs } = props;
    if (!cztxlDefs?.templates) {
        return null
    }
    return <Modal width={800} bodyStyle={{
        height: 500,
         overflow: 'auto'
    }} title="详情" open={props.open} onCancel={e => props.onCancel?.()}>
        <Descriptions column={2} bordered size="middle">{cztxlDefs?.templates?.map(item => {
            return <Descriptions.Item key={item.dataIndex} label={item.title}>{record?.[item.dataIndex]}</Descriptions.Item>
        })}</Descriptions>
    </Modal>;
}